package Demo10;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;


@Configuration//用来表此类是一个配置类
@ComponentScan("Demo10")//用于告知Spring要扫描哪个包
public class Demo {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context
                = new AnnotationConfigApplicationContext(Demo.class);
        Person person = context.getBean(Person.class);
        System.out.println(person);
    }
}
